package org.kfive.nova.model;

import fr.xebia.extras.selma.Selma;
import org.kfive.nova.mapper.StudentMapper;

/**
 * Created by admin on 2017-05-01.
 */
public class StudentDTO {

    private Integer id;

    private String name;

    private Integer sex;

    private Integer birth;

    private String department;

    private String address;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getSex() {
        return sex;
    }

    public void setSex(Integer sex) {
        this.sex = sex;
    }

    public Integer getBirth() {
        return birth;
    }

    public void setBirth(Integer birth) {
        this.birth = birth;
    }

    public String getDepartment() {
        return department;
    }

    public void setDepartment(String department) {
        this.department = department;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("StudentDTO{");
        sb.append("id=").append(id);
        sb.append(", name='").append(name).append('\'');
        sb.append(", sex=").append(sex);
        sb.append(", birth=").append(birth);
        sb.append(", department='").append(department).append('\'');
        sb.append(", address='").append(address).append('\'');
        sb.append('}');
        return sb.toString();
    }

    public static void main(String[] args) {
        //StudentMapper studentMapper = Selma.mapper(StudentMapper.class);
        StudentMapper studentMapper = Selma.builder(StudentMapper.class).build();
        Student student = new Student();
        student.setAddress("testAddress");
        student.setBirth(20);
        student.setDepartment("testDepartment");
        student.setId(1);
        student.setName("testName");
        student.setSex(1);
        StudentDTO studentDTO = studentMapper.asDTOBean(student);
        System.out.println(studentDTO.toString());
    }
}
